﻿CREATE PROCEDURE eCitizen_Personalised.usp_InsertSMSLog
@AgencyServiceCode varchar(10),
@ProcessedDateTime DateTime,
@ProcessedFileName varchar(MAX),
@TotalSuccessful int,
@TotalPending int,
@TotalFailure int
AS
BEGIN

	DECLARE @ServiceId INT
	
	SELECT @ServiceId = ServiceId from eCitizen_Personalised.Service where AgencyCode = @AgencyServiceCode
	
	Insert into eCitizen_Personalised.[SmsLog]
	(ServiceId,ProcessedDateTime,ProcessedFileName,TotalSuccessful,TotalPending,TotalFailure,CreatedDate,Createdby)
	Values
	(@ServiceId,@ProcessedDateTime,@ProcessedFileName,@TotalSuccessful,@TotalPending,@TotalFailure,GETDATE(),'System')
END